# Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_executable(ntptime_openiot-test
    test_ntptime_openiot.cpp

    ../platform/src/ntptime_openiot.c
)

target_link_libraries(ntptime_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(ntptime_openiot-test)

add_executable(tickcounter_openiot-test
    test_tickcounter_openiot.cpp

    ../platform/src/tickcounter_openiot.c
)

target_link_libraries(tickcounter_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(tickcounter_openiot-test)

add_executable(platform_openiot-test
    test_platform_openiot.cpp

    ../platform/src/platform_openiot.c
)

target_link_libraries(platform_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(platform_openiot-test)

add_executable(socketio_openiot-test
    test_socketio_openiot.cpp

    ../platform/src/socketio_openiot.c
)

target_include_directories(socketio_openiot-test
    PRIVATE
        mocks/inc
)

target_link_libraries(socketio_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(socketio_openiot-test)

add_executable(tcpsocketconnection_openiot-test
    test_tcpsocketconnection_openiot.cpp

    ../platform/src/tcpsocketconnection_openiot.c
)

target_include_directories(tcpsocketconnection_openiot-test
    PRIVATE
        mocks/inc
)

target_link_libraries(tcpsocketconnection_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(tcpsocketconnection_openiot-test)

add_executable(threadapi_openiot-test
    test_threadapi_openiot.cpp

    ../platform/src/threadapi_openiot.c
)

target_include_directories(threadapi_openiot-test
    PRIVATE
        mocks/inc
)

target_link_libraries(threadapi_openiot-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(threadapi_openiot-test)

add_executable(iot_ntp_client-test
    test_iot_ntp_client.cpp

    ../ntp-client/src/iot_ntp_client.c
)

target_link_libraries(iot_ntp_client-test
    PRIVATE
        fff
        project_options
        project_warnings
        cmsis-rtos-api-mock
        azure-iot-sdk-c-mocks
)

iotsdk_add_test(iot_ntp_client-test)
